package com.zebra.common;


import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * 广播 范围 类型
 */
public enum ZbmAreaType {

    Global(0), //全部
    Game(1), //
    Person(2);

    private final int code;

    ZbmAreaType(final int code) {
        this.code = code;
    }

    private final static Map<Integer, ZbmAreaType> map  = Arrays.stream(ZbmAreaType.values()).collect(Collectors.toMap(ZbmAreaType::code, t -> t));

    public int code() {
        return this.code;
    }

    public static ZbmAreaType codeOf(int code){
        return map.get(code);
    }

}
